<template>
  <div>
    <!-- 信息区域 -->
    <div class="info">
      <el-form ref="ref" :model="form" label-width="80px">
        <el-form-item label="姓名：" prop="student_name">
          <el-input :disabled="true" v-model="form.student_name"></el-input>
        </el-form-item>
        <el-form-item label="学号：" prop="student_num">
          <el-input :disabled="true" v-model="form.student_num"></el-input>
        </el-form-item>
        <el-form-item label="学院：" prop="student_college">
          <el-input :disabled="true" v-model="form.student_college"></el-input>
        </el-form-item>
        <el-form-item label="电话：" prop="phone">
          <el-input :disabled="true" v-model="form.phone"></el-input>
        </el-form-item>
        <el-form-item label="邮箱：" prop="email">
          <el-input :disabled="true" v-model="form.email"></el-input>
        </el-form-item>
        <!-- <el-form-item v-model="form.username" label="地址：">
          <el-input></el-input>
        </el-form-item> -->
        <el-button @click="update()">返回</el-button>
      </el-form>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  // 生命周期，创建完成后自动执行
  created() {
    this.getinfo();
  },
  data() {
    return {
      form: {},
    };
  },
  methods: {
    // 发送获取个人信息的请求
    getinfo() {
      const n = window.location.hash.substring(17);
      //   console.log(n);
      axios
        .post("http://127.0.0.1:8080/minAdmin/get_student?id=" + n)
        .then((res) => {
          this.form = res.data.data[0];
          //   console.log(res);
        });
    },
    // 提交按钮的函数
    update() {
      this.$router.go(-1);
    },
  },
};
</script>
<style lang="less" scoped>
.info {
  width: 300px;
}
</style>
